# coding: utf8

import requests
import time
import sys


def testFunction(start,end,url,params):
    
    reload(sys)
    sys.setdefaultencoding('utf-8')
    
    for x in range(start,end):
        data = params
        print('send data: %s' % str(data))
        try:
            res = requests.post(url,data=data)
            print(res.headers)
            print(res.cookies)
            print(len(res.cookies),'=============')
            r = open("log.html","w")
            r.write(res.text)
            r.close()
            print("ok")
        except Exception as e:
            print("-----26-----",e)
        e = time.time()
        print("take time: %s" % (e - s))
        s = e
        
    endtime = time.time()
    print("take time: %s" % (endtime - starttime))